//# sourceURL=http://uMapApp/UI/Panel/Panel
define([
    "mhjs/mhjs"
], function (
    mhjs
) {

    function Panel(option) {

        var _this = this;
        _this.isOpened = false;

        mhjs.Div.call(_this, option);
        _this.addClass("panel");

    }

    var _class = Panel;
    mhjs.Inherit(_class, mhjs.Div);


    Object.defineProperties(_class.prototype, {
        "open"        : {
            value: function (stopPropagation) {
                var _this = this;
                _this.isOpened = true;
                _this.addClass("open");
                stopPropagation !== false && _this.trigger("open");
                stopPropagation !== false && _this.trigger("toggle");
            }
        },
        "close"       : {
            value: function (stopPropagation) {
                var _this = this;
                _this.isOpened = false;
                _this.removeClass("open");
                stopPropagation !== false && _this.trigger("close");
                stopPropagation !== false && _this.trigger("toggle");
            }
        },
        "toggle"      : {
            value: function (stopPropagation) {
                var _this = this;
                if (_this.isOpened) {
                    _this.close(stopPropagation);
                } else {
                    _this.open(stopPropagation);
                }
            }
        },
        "max"         : {
            value: function (stopPropagation) {
                var _this = this;
                _this.isMined = false;
                _this.removeClass("min");
                stopPropagation !== false && _this.trigger("max");
                stopPropagation !== false && _this.trigger("toggleMinMax");
            }
        },
        "min"         : {
            value: function (stopPropagation) {
                var _this = this;
                _this.isMined = true;
                _this.addClass("min");
                stopPropagation !== false && _this.trigger("min");
                stopPropagation !== false && _this.trigger("toggleMinMax");
            }
        },
        "toggleMinMax": {
            value: function (stopPropagation) {
                var _this = this;
                if (_this.isMined) {
                    _this.max(stopPropagation);
                } else {
                    _this.min(stopPropagation);
                }
            }
        }
    });

    return _class;

});